package org.dtrd.modules.service.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.service.entity.po.DtrdEntRdService;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 服务套餐信息
 * </p>
 *
 * @author QR
 * @since 2021-11-19 18:52:54
 */
@Getter
@Setter
@ApiModel(value = "服务套餐详情数据对象")
public class ServiceDetail {

    private Integer dataId;

    @NotNull
    @ApiModelProperty(value = "服务分类id")
    private Integer serviceCategoryId;

    @NotBlank(message = "服务名称不能为空")
    @ApiModelProperty("服务名称")
    private String serviceName;

    @NotBlank(message = "品牌设备不能为空")
    @ApiModelProperty("品牌/设备")
    private String serviceBrand;

    @ApiModelProperty("服务价格")
    private Float servicePrice;

    @ApiModelProperty("服务折扣价")
    private Float serviceDiscount;

    @ApiModelProperty("服务照片链接, 多个照片用 | 分隔")
    private String servicePhoto;

    @NotBlank(message = "服务描述不能为空")
    @ApiModelProperty("服务描述")
    private String serviceDesc;

    @NotBlank(message = "执行角色不能为空")
    @ApiModelProperty(value = "职位code", notes = "多个职位code之间用逗号隔开")
    private String executorIds;

    @NotBlank(message = "机构编码不能为空")
    @ApiModelProperty(value = "机构编码",required = true)
    private String orgCode;


    public ServiceDetail parseFromPo(DtrdEntRdService po) {
        dataId = po.getDataId();
        serviceCategoryId = po.getServiceCategoryId();
        serviceName = po.getServiceName();
        serviceBrand = po.getServiceBrand();
        servicePrice = po.getServicePrice();
        serviceDiscount = po.getServiceDiscount();
        servicePhoto = po.getServicePhoto();
        serviceDesc = po.getServiceDesc();
        executorIds = po.getExecutorIds();
        orgCode = po.getOrgCode();
        return this;
    }


}
